<%@ page isELIgnored ="false" pageEncoding="UTF-8" %> 
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>Make Bet</title>
	<link rel="stylesheet" type="text/css" href="styles3.css" />
	</head>

	<body>
		<script language="javascript" type="text/javascript">
			function checkNumber(form){
				form.play.disabled = isNaN(form.number.value);
			}
			function checkAmount(form){
				form.play.disabled = isNaN(form.amount.value);
			}
			
			function validar(form) {  
			     var1 = form.amount.value;
			     var2 = form.number.value; 
			     if (var2<0 || var2>36){
			    	 alert("El numero a apostar debe estar entre 0 y 36");  
				     return false; 
			     } else {
					 if (var1 <= 0) {  
				     	alert("El numero de chips debe ser positivo mayor a 0");  
				        return false;  
				     } else {  
				    	 //if (var1 > )
				         alert("OK, los valores introducidos son correctos."); 
				         return true ; 
				     }
			     }
			}
		</script>
		
		<form method="post" action="makeBet" onsubmit="return validar(this);">
			<span>Number To Bet:</span> <input name="number" type="text" onkeyup="checkNumber(this.form)"> </input> <br />
			<span>Amount of Chips:</span> <input name="amount" type="text" onkeyup="checkAmount(this.form)"> </input> <br />
			<input type="submit" name="ok" id="ok" value="ok"/>
			<input type="button" name="cancel" id="cancel" value="Cancel" onclick="javascript:alert('Me cancelaaaan');"/>
		</form>
	</body>
</html>